
{* Extend our master template *}
{extends file="master.tpl"}

{* This block is defined in the master.php template *}
{block name=content}
    <div class="row">
        <div class="col-md-12">
            <form id="form" class="form-horizontal" method="post" enctype="multipart/form-data">
                <div class="panel panel-default">
                    {include file="components/panel_heading.tpl" title=$title sub_title=$sub_title}
                    <div class="panel-body">

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{'section'|trans}</label>
                            <div class="col-sm-3">
                                <select name="section" id="section" class="select2" required>
                                    <option></option>
                                    {foreach from=$section item=sec}
                                        <option value="{$sec['id']}" {if isset($_POST['section']) && $_POST['section'] == $sec['id']} selected="selected" {/if}>{$sec['title']}</option>
                                    {/foreach}
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{'catalogue'|trans}</label>
                            <div class="col-sm-3">
                                <select name="catalogue" id="catalogue" class="select2" required>
                                    <option></option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{'upload'|trans}</label>
                            <div class="col-sm-3">
                                <input type="file" name="art_img" class="form-control">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{'tags'|trans}</label>
                            <div class="col-sm-9">
                                <input type="text" name="tags" id="tags" class="form-control" value="{'tags'|set_value}">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{'keywords'|trans}</label>
                            <div class="col-sm-9">
                                <textarea name="keywords" class="form-control">{'keywords'|set_value}</textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">{'description'|trans}</label>
                            <div class="col-sm-9">
                                <textarea name="description" class="form-control">{'description'|set_value}</textarea>
                            </div>
                        </div>
                        
                        <ul class="nav nav-tabs">
                            {assign var="i" value='0'}
                            {foreach from=$language item=lang}
                                <li {if $i==0}class="active"{/if}><a href="#{$lang['lang_code']}" data-toggle="tab">{$lang['country']}</a></li>
                                {assign var="i" value=$i+1}
                            {/foreach}
                        </ul>

                        <div class="tab-content">
                            {assign var="i" value=0}
                            {foreach from=$language item=lang}
                                <div class="tab-pane fade {if $i==0}in active{/if} form-group" id="{$lang["lang_code"]}">
                            
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">{'title'|trans}</label>
                                        <div class="col-sm-9">
                                            <input type="text" name="art_title_{$lang["lang_code"]}" class="form-control" value="{'art_title_$lang["lang_code"]'|set_value}" required>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">{'information'|trans}</label>
                                        <div class="col-sm-9">
                                            <textarea name="art_info_{$lang["lang_code"]}" class="infoEditor form-control" rows="4" required>{'art_info_.$lang["lang_code"]'|set_value}</textarea>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">{'content'|trans}</label>
                                        <div class="col-sm-9">
                                            <textarea name="art_content_{$lang["lang_code"]}" class="contentEditor form-control" rows="10" required>{'art_content_$lang["lang_code"]'|set_value}</textarea>
                                        </div>
                                    </div>
                                </div>
                                {assign var="i" value=$i+1}
                            {/foreach}
                        </div>
                    </div><!-- panel-body -->
                    {include file="components/panel_footer.tpl"}
                </div><!-- panel -->
            </form>
        </div>
    </div>
{/block}